#!/usr/bin/env perl

use utf8;
use strict;

my %word_count = ();

while(chomp(my $input = <STDIN>)){
	if(exists $word_count{$input}){
		$word_count{$input} = $word_count{$input} + 1;
	}
	else{
		$word_count{$input} = 1;
	}
}

printf "%19s+\t+%-19s\n" => "-" x 19, "-" x 19;

foreach my $word (sort keys %word_count){
	printf "%20s\t%-20s\n" => $word, $word_count{$word};
}
